home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 0022-3.564 / dmg-3452 / articles / bubble.doc < prev    next >
Text File  |  1987-04-21  |  5KB  |  138 lines

  1.  
  2.                     BUBBLE FIELD MAKER/DISPLAYER
  3.                            BY EDDIE BRYAN
  4.  
  5. What is a bubble field, well according to me it is a star field, 
  6. which  instead  of having tiny  stars,  has  sprites,  and  these 
  7. sprites look like like bubbles, hence the name.....
  8.  
  9. There  are  two sources in the bubble folder,  one is  the  field 
  10. designer,  and the other is the display routine, the maker source 
  11. is  just  an adapted version on the star field  generator  in  HP 
  12. issue 1, so I wont go into how that works (see end of article for 
  13. explanation on how the field designer works).
  14.     
  15. The field display routine simply sets logical screen to point  at 
  16. back,  every  vertical  blank the old bubbles are wiped  off  the 
  17. screen , and the new ones are drawn, the bubbles themselves are 2 
  18. plane images, so you only need set the first 3 colours to  change 
  19. their colour,  the display routine uses about 1/3 processor time, 
  20. but this will change depending on how many bubbles you have.
  21.  
  22. If you look at the display source,  you will see that the drawing 
  23. is  done  by a small 68000 program,  the DREG(0) is  set  to  the 
  24. number of bubbles-1, bank(5) has field data, every VBL a constant 
  25. is  added  to  ST(field frame),  this number  is  the  number  of 
  26. bubbles*4,  so  20 bubbles will be equal to 80(get  it??,  didn't 
  27. think so!)
  28.  
  29. Now here is the instructions for STARFIELD MAKER.......
  30.  
  31.  
  32.  
  33.                      STOS STARFIELD DESIGNER
  34.                      ~~~~~~~~~~~~~~~~~~~~~~~
  35.  
  36.                                BY
  37.                          WILLIAM BRYAN
  38.  
  39.      "God, I wish I could work out the waves for those bloody 
  40. starfields everybody is doing these days!", said Eddie, or at 
  41. least something with the same meaning, to Will, mathematical 
  42. problem solver extroudinair.
  43.  
  44.      "Well, I'm sure I'll be able to fit you in sometime this year 
  45. (being 1991)..........NURSE.....CAN YOU SEND THE NEXT PATIENT IN 
  46. PLEASE?"
  47.  
  48.           Well, it was November, that's right the month before 
  49. December and the one after October, or is it August, or may be 
  50. July, sod it, I can't remember, when I finally started.
  51.  
  52.      The routine works basically like this, define vanashing point (In 
  53. low res 160,100) where all stars will zoom out from at a radius 
  54. set from this point. A number of arrays are set  up to hold X and 
  55. Y positions for each star for each frame. 
  56.  
  57.      Using the SIN and COSINE functions available in stos the X and Y 
  58. postions can be worked out for each star in each frame by 
  59. increasing the radius GEOMETRICALLY (Multiplying by say 1.25) or 
  60. ARITHMATICALLY (Adding 2) each time. This process creats the feel 
  61. of the stars zooming past.
  62.  
  63.      Well you now how it's supposesd to work, but forget about that, 
  64. this is how it really works, for all you LAMERS out their, not 
  65. mentioning any names, JOHN GREEN.
  66.  
  67.      At line 48 and 49 in the programme (Ooh arr, misses) a large 
  68. number of varibubbles (As I like to call them) are set to 
  69. different values, these of cause have drastic effects on the out 
  70. come of the starfield.
  71.  
  72.      YMX - The maximum value of Y for a star, once beyond this 
  73.            point the star is ignored and isn't shown or stored
  74.  
  75.      YMN - The minimum value of Y - See above
  76.  
  77.      XMX - The maximum value of X - See YMX
  78.  
  79.      XMN - The minimum value of X - See above
  80.  
  81.      
  82. HOW TO MAKE YOUR STARS LOOK GOOD (Part I)
  83.  
  84.      AIN# - ANGLE INCREASE VALUE (per frame) By setting this 
  85.           different to 0 you can creat spiraling starfields, at 
  86.           least as good as the starfield on OOH CRIKEY WHAT A SCORCHER
  87.  
  88.      AF# - Accelleration factor/increase. If prop is set to 1 
  89.          then the radius of the stars from the origin is multiplyed by 
  90.          this figue, else AF# is added to the radius
  91.  
  92.      PROP - See above
  93.  
  94.      NS - Number of stars - USES UP MEMORY VERY QUICKLY WHEN 
  95.           INCREASED
  96.  
  97.      NF - Number of frames - USES UP MEMORY VERY QUICKLY WHEN 
  98.           INCREASED
  99.  
  100.      MNR - Minimum radius value - for first frame of every star
  101.  
  102.      MXR - Maximum radius value - see above
  103.  
  104.      MNA - Minimum angle - used for creating semi-circular and 
  105.            other sized/shaped starfields
  106.  
  107.      MXA - Maximum angle - see above
  108.  
  109.      DCP# - Depth Cued Percentage - set to 0.5 for grey stars 
  110.      first half of frames and second half white stars, can be chanegd 
  111.      to create better effects
  112.  
  113.      SX - Is automatically set to centre of starfield area - 
  114.      should be changed to make optimumum use of semi-circular 
  115.      starfields, etc
  116.  
  117.      SY - Y centre - see above
  118.  
  119. Well the programme.....
  120.  
  121.      lines 55-100 create star flight paths
  122.  
  123.      lines 110-240 rearrange stars so they don't all start at 
  124.      same point and it chooses depth cued stars
  125.  
  126.      lines 20000+ VECTCON.BAS built in to save a hell of a lot of 
  127.      memory
  128.  
  129.      lines 1000-1230 DOT DISPLAY ROUTINE - Built in for easy use, 
  130.      uses machine code routine in bank 9 to plot stars
  131.  
  132. Well I hope you have more fun with my Starfield designer that I 
  133. had writing this artical for STOS BITS 2, HP SOURCE what ever you 
  134. want to call it.
  135.  
  136.  
  137.  
  138.